package cn.chaohi.controller.model.versionConfig;

import cn.chaohi.common.ApiException;
import cn.chaohi.common.CodeEnum;
import cn.chaohi.utils.RegexUtils;

public class ConfigAndVersionReq {

	// 超市ID
	private String marketId;
	// 超市門店ID
	private String marketStoreId;
	// 车号
	private String cartNum;
	// 车子pad wifi的mac地址
	private String wifiMac;
	// 老版本
	private String oldVersion;
	
	public void validate() throws Exception {
		if (RegexUtils.isEmpty(marketId)) {
			throw new ApiException(CodeEnum.MARKET_ID);
		}
		if (RegexUtils.isEmpty(marketStoreId)) {
			throw new ApiException(CodeEnum.MARKET_STORE_ID);
		}
		if (RegexUtils.isEmpty(wifiMac)) {
			throw new ApiException(CodeEnum.WIFI_MAC);
		}
		if (RegexUtils.isEmpty(oldVersion)) {
			throw new ApiException(CodeEnum.OLD_VERSION);
		}
	}
	
	public String getMarketId() {
		return marketId;
	}
	public void setMarketId(String marketId) {
		this.marketId = marketId;
	}
	public String getMarketStoreId() {
		return marketStoreId;
	}
	public void setMarketStoreId(String marketStoreId) {
		this.marketStoreId = marketStoreId;
	}
	public String getCartNum() {
		return cartNum;
	}
	public void setCartNum(String cartNum) {
		this.cartNum = cartNum;
	}
	public String getWifiMac() {
		return wifiMac;
	}
	public void setWifiMac(String wifiMac) {
		this.wifiMac = wifiMac;
	}
	public String getOldVersion() {
		return oldVersion;
	}
	public void setOldVersion(String oldVersion) {
		this.oldVersion = oldVersion;
	}
	public ConfigAndVersionReq() {
		super();
	}
}
